#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n = 0;
    int arr[51];
    scanf("%d %d", &n, &arr[0]);
    int k = arr[0];
    int s = 0;
    int j = 0;
    for (int i = 1; i < n; i++)
    {
        scanf("%d", &arr[i]);
        if (k <= arr[i])
        {
            s++;
        }
        if (k > arr[i])
        {
            j++;
        }
        k = arr[i];
    }
    if (s == n - 1 || j == n - 1)
    {
        printf("sorted\n");
    }
    else
    {
        printf("unsorted\n");
    }
    return 0;
}